package com.bysj.sausys.util;

import java.io.UnsupportedEncodingException;

/**
 * 字符转换工具类
 *
 * @author WangZK
 */
public class EncodingUtil {

    public static String encodeStr(String str) {
        if (str == null || "".equals(str)) {
            return null;
        } else {
            try {
                return new String(str.getBytes("ISO-8859-1"), "UTF-8");
            } catch (UnsupportedEncodingException e) {
                e.printStackTrace();
                return null;
            }
        }
    }

}
